package com.ruoyi.framework.config.properties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class TenantProperties {

    private static TenantProperties instance;

    private Boolean enable = true;

    private String defaultTenantId = "000000";

    /**
     * 多租户字段名称
     */
    private String column = "tenant_id";

    /**
     * 多租户系统数据表
     */
    private List<String> ignoreTables = new ArrayList<>();


    private TenantProperties() {
    }

    public static TenantProperties getInstance() {
        if (instance == null) {
            instance = new TenantProperties();
            instance.getIgnoreTables().addAll(Arrays.asList("sys_menu", "sys_config", "sys_dict_data", "sys_dict_type"
                    , "sys_role_data_rule", "gen_table", "columns", "tables", "sys_post",
                    "gen_table_column", "sys_role_menu", "sys_logininfor", "sys_tenant", "sys_user", "sys_user_post"
                    , "sys_role_dept", "sys_role_menu", "sys_role", "sys_dept", "sys_user_role", "sys_job", "sys_job_log", "sys_oper_log",
                    "t_protocol_table", "t_warn_strategy", "az_table", "t_terminal_type","t_sheets","t_sheets_users"
                    ,"t_meter_reading_rate",
                    "public_share_report"));
        }
        return instance;
    }

    public static void setInstance(TenantProperties instance) {
        TenantProperties.instance = instance;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getDefaultTenantId() {
        return defaultTenantId;
    }

    public void setDefaultTenantId(String defaultTenantId) {
        this.defaultTenantId = defaultTenantId;
    }

    public String getColumn() {
        return column;
    }

    public void setColumn(String column) {
        this.column = column;
    }

    public List<String> getIgnoreTables() {
        return ignoreTables;
    }

    public void setIgnoreTables(List<String> ignoreTables) {
        this.ignoreTables = ignoreTables;
    }
}
